<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            list-style: none;
            color: white;
            font-weight: bold;
        }

        p {
            font-size: 25px;
        }

        div {
            width: 400px;
            height: 300px;
            background: black;
        }

        li {
            height: 35px;
            margin-bottom: 10px;
            margin-left: 8px;
            background: #0099CC;
            line-height: 35px;
            border-radius: 0 25px 25px 0;
        }

        span {
            margin-left: 8px;
        }

        input {
            width: 40px;
            height: 25px;
            border: 0;
            margin-left: 8px;
            margin-right: 8px;
            border-radius: 5px;
            font-size: 16px;
            color: #0099CC;
            background: #333333;
            cursor: pointer;
        }
    </style>
</head>
<body>
<div>
    <p>你最喜欢的编程语言是哪一种?</p>
    <ul>
        <li id="b1" style="width: 180px;"><span id="a1">0</span> <input type="button" value="投票" id="1" onclick="f(this.id)">PHP</li>
        <li id="b2" style="width: 180px;"><span id="a2">0</span> <input type="button" value="投票" id="2" onclick="f(this.id)">Ruby</li>
        <li id="b3" style="width: 180px;"><span id="a3">0</span> <input type="button" value="投票" id="3" onclick="f(this.id)">Java</li>
        <li id="b4" style="width: 180px;"><span id="a4">0</span> <input type="button" value="投票" id="4" onclick="f(this.id)">C++</li>
        <li id="b5" style="width: 180px;"><span id="a5">0</span> <input type="button" value="投票" id="5" onclick="f(this.id)">JavaScript</li>
        <li id="b6" style="width: 180px;"><span id="a6">0</span> <input type="button" value="投票" id="6" onclick="f(this.id)">Python</li>
    </ul>
</div>
<script>
    function f(val) {
        var a = "a"+val;
        document.getElementById(a).innerText = parseInt(document.getElementById(a).innerText)+1;
        var b = "b"+val;
        var a1 = document.getElementById(b).style.width;
        var num = a1.split("px")[0];
        document.getElementById(b).style.width = parseInt(num)+20+"px";
    }
</script>
</body>
</html>